<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>PolkitPermission</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="polkit Reference Manual">
<link rel="up" href="ref-api.html" title="Part III. Client API Reference">
<link rel="prev" href="PolkitTemporaryAuthorization.html" title="PolkitTemporaryAuthorization">
<link rel="next" href="subjects.html" title="Subjects">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="PolkitTemporaryAuthorization.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ref-api.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">polkit Reference Manual</th>
<td><a accesskey="n" href="subjects.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#PolkitPermission.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#PolkitPermission.description" class="shortcut">Description</a>
                   | 
                  <a href="#PolkitPermission.object-hierarchy" class="shortcut">Object Hierarchy</a>
                   | 
                  <a href="#PolkitPermission.implemented-interfaces" class="shortcut">Implemented Interfaces</a>
                   | 
                  <a href="#PolkitPermission.properties" class="shortcut">Properties</a>
</td></tr>
</table>
<div class="refentry">
<a name="PolkitPermission"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="PolkitPermission.top_of_page"></a>PolkitPermission</span></h2>
<p>PolkitPermission — PolicyKit <a href="http://library.gnome.org/devel/gio/unstable/GPermission.html"><span class="type">GPermission</span></a> implementation</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="PolkitPermission.stability-level"></a><h2>Stability Level</h2>
Stable, unless otherwise indicated
</div>
<div class="refsynopsisdiv">
<a name="PolkitPermission.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">                    <a class="link" href="PolkitPermission.html#PolkitPermission-struct" title="PolkitPermission">PolkitPermission</a>;
<span class="returnvalue">void</span>                <a class="link" href="PolkitPermission.html#polkit-permission-new" title="polkit_permission_new ()">polkit_permission_new</a>               (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *action_id</code></em>,
                                                         <em class="parameter"><code><a class="link" href="PolkitSubject.html" title="PolkitSubject"><span class="type">PolkitSubject</span></a> *subject</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
<a href="http://library.gnome.org/devel/gio/unstable/GPermission.html"><span class="returnvalue">GPermission</span></a> *       <a class="link" href="PolkitPermission.html#polkit-permission-new-finish" title="polkit_permission_new_finish ()">polkit_permission_new_finish</a>        (<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html"><span class="type">GAsyncResult</span></a> *res</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
<a href="http://library.gnome.org/devel/gio/unstable/GPermission.html"><span class="returnvalue">GPermission</span></a> *       <a class="link" href="PolkitPermission.html#polkit-permission-new-sync" title="polkit_permission_new_sync ()">polkit_permission_new_sync</a>          (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *action_id</code></em>,
                                                         <em class="parameter"><code><a class="link" href="PolkitSubject.html" title="PolkitSubject"><span class="type">PolkitSubject</span></a> *subject</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);
const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       <a class="link" href="PolkitPermission.html#polkit-permission-get-action-id" title="polkit_permission_get_action_id ()">polkit_permission_get_action_id</a>     (<em class="parameter"><code><a class="link" href="PolkitPermission.html" title="PolkitPermission"><span class="type">PolkitPermission</span></a> *permission</code></em>);
<a class="link" href="PolkitSubject.html" title="PolkitSubject"><span class="returnvalue">PolkitSubject</span></a> *     <a class="link" href="PolkitPermission.html#polkit-permission-get-subject" title="polkit_permission_get_subject ()">polkit_permission_get_subject</a>       (<em class="parameter"><code><a class="link" href="PolkitPermission.html" title="PolkitPermission"><span class="type">PolkitPermission</span></a> *permission</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="PolkitPermission.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
   +----<a href="http://library.gnome.org/devel/gio/unstable/GPermission.html">GPermission</a>
         +----PolkitPermission
</pre>
</div>
<div class="refsect1">
<a name="PolkitPermission.implemented-interfaces"></a><h2>Implemented Interfaces</h2>
<p>
PolkitPermission implements
 <a href="http://library.gnome.org/devel/gio/unstable/GInitable.html">GInitable</a> and  <a href="http://library.gnome.org/devel/gio/unstable/GAsyncInitable.html">GAsyncInitable</a>.</p>
</div>
<div class="refsect1">
<a name="PolkitPermission.properties"></a><h2>Properties</h2>
<pre class="synopsis">
  "<a class="link" href="PolkitPermission.html#PolkitPermission--action-id" title='The "action-id" property'>action-id</a>"                <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write / Construct Only
  "<a class="link" href="PolkitPermission.html#PolkitPermission--subject" title='The "subject" property'>subject</a>"                  <a class="link" href="PolkitSubject.html" title="PolkitSubject"><span class="type">PolkitSubject</span></a>*        : Read / Write / Construct Only
</pre>
</div>
<div class="refsect1">
<a name="PolkitPermission.description"></a><h2>Description</h2>
<p>
<a class="link" href="PolkitPermission.html" title="PolkitPermission"><span class="type">PolkitPermission</span></a> is a <a href="http://library.gnome.org/devel/gio/unstable/GPermission.html"><span class="type">GPermission</span></a> implementation. It can be used
with e.g. <span class="type">GtkLockButton</span>. See the <a href="http://library.gnome.org/devel/gio/unstable/GPermission.html"><span class="type">GPermission</span></a> documentation for
more information.
</p>
</div>
<div class="refsect1">
<a name="PolkitPermission.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="PolkitPermission-struct"></a><h3>PolkitPermission</h3>
<pre class="programlisting">typedef struct _PolkitPermission PolkitPermission;</pre>
<p>
The <a class="link" href="PolkitPermission.html" title="PolkitPermission"><span class="type">PolkitPermission</span></a> struct should not be accessed directly.
</p>
</div>
<hr>
<div class="refsect2">
<a name="polkit-permission-new"></a><h3>polkit_permission_new ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                polkit_permission_new               (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *action_id</code></em>,
                                                         <em class="parameter"><code><a class="link" href="PolkitSubject.html" title="PolkitSubject"><span class="type">PolkitSubject</span></a> *subject</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a> callback</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
<p>
Creates a <a href="http://library.gnome.org/devel/gio/unstable/GPermission.html"><span class="type">GPermission</span></a> instance for the PolicyKit action
<em class="parameter"><code>action_id</code></em>.
</p>
<p>
When the operation is finished, <em class="parameter"><code>callback</code></em> will be invoked. You can
then call <a class="link" href="PolkitPermission.html#polkit-permission-new-finish" title="polkit_permission_new_finish ()"><code class="function">polkit_permission_new_finish()</code></a> to get the result of the
operation.
</p>
<p>
This is a asynchronous failable constructor. See
<a class="link" href="PolkitPermission.html#polkit-permission-new-sync" title="polkit_permission_new_sync ()"><code class="function">polkit_permission_new_sync()</code></a> for the synchronous version.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>action_id</code></em> :</span></p></td>
<td>The PolicyKit action identifier.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>subject</code></em> :</span></p></td>
<td>A <a class="link" href="PolkitSubject.html" title="PolkitSubject"><span class="type">PolkitSubject</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for the current process. <span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>callback</code></em> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a> to call when the request is satisfied.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
<td>The data to pass to <em class="parameter"><code>callback</code></em>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="polkit-permission-new-finish"></a><h3>polkit_permission_new_finish ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/gio/unstable/GPermission.html"><span class="returnvalue">GPermission</span></a> *       polkit_permission_new_finish        (<em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html"><span class="type">GAsyncResult</span></a> *res</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Finishes an operation started with <a class="link" href="PolkitPermission.html#polkit-permission-new" title="polkit_permission_new ()"><code class="function">polkit_permission_new()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>res</code></em> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html"><span class="type">GAsyncResult</span></a> obtained from the <a href="http://library.gnome.org/devel/gio/unstable/GAsyncResult.html#GAsyncReadyCallback"><span class="type">GAsyncReadyCallback</span></a> passed to <a class="link" href="PolkitPermission.html#polkit-permission-new" title="polkit_permission_new ()"><code class="function">polkit_permission_new()</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>Return location for error or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/gio/unstable/GPermission.html"><span class="type">GPermission</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>error</code></em> is set.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="polkit-permission-new-sync"></a><h3>polkit_permission_new_sync ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/gio/unstable/GPermission.html"><span class="returnvalue">GPermission</span></a> *       polkit_permission_new_sync          (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *action_id</code></em>,
                                                         <em class="parameter"><code><a class="link" href="PolkitSubject.html" title="PolkitSubject"><span class="type">PolkitSubject</span></a> *subject</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> *cancellable</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre>
<p>
Creates a <a href="http://library.gnome.org/devel/gio/unstable/GPermission.html"><span class="type">GPermission</span></a> instance for the PolicyKit action
<em class="parameter"><code>action_id</code></em>.
</p>
<p>
This is a synchronous failable constructor. See
<a class="link" href="PolkitPermission.html#polkit-permission-new" title="polkit_permission_new ()"><code class="function">polkit_permission_new()</code></a> for the asynchronous version.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>action_id</code></em> :</span></p></td>
<td>The PolicyKit action identifier.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>subject</code></em> :</span></p></td>
<td>A <a class="link" href="PolkitSubject.html" title="PolkitSubject"><span class="type">PolkitSubject</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for the current process. <span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cancellable</code></em> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/gio/unstable/GCancellable.html"><span class="type">GCancellable</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>Return location for error or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<a href="http://foldoc.org/allow-none"><span class="acronym">allow-none</span></a>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/gio/unstable/GPermission.html"><span class="type">GPermission</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>error</code></em> is set.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="polkit-permission-get-action-id"></a><h3>polkit_permission_get_action_id ()</h3>
<pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *       polkit_permission_get_action_id     (<em class="parameter"><code><a class="link" href="PolkitPermission.html" title="PolkitPermission"><span class="type">PolkitPermission</span></a> *permission</code></em>);</pre>
<p>
Gets the PolicyKit action identifier used for <em class="parameter"><code>permission</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>permission</code></em> :</span></p></td>
<td>A <a class="link" href="PolkitPermission.html" title="PolkitPermission"><span class="type">PolkitPermission</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A string owned by <em class="parameter"><code>permission</code></em>. Do not free.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="polkit-permission-get-subject"></a><h3>polkit_permission_get_subject ()</h3>
<pre class="programlisting"><a class="link" href="PolkitSubject.html" title="PolkitSubject"><span class="returnvalue">PolkitSubject</span></a> *     polkit_permission_get_subject       (<em class="parameter"><code><a class="link" href="PolkitPermission.html" title="PolkitPermission"><span class="type">PolkitPermission</span></a> *permission</code></em>);</pre>
<p>
Gets the subject used for <em class="parameter"><code>permission</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>permission</code></em> :</span></p></td>
<td>A <a class="link" href="PolkitPermission.html" title="PolkitPermission"><span class="type">PolkitPermission</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>An object owned by <em class="parameter"><code>permission</code></em>. Do not free. <span class="annotation">[<a href="http://foldoc.org/transfer%20none"><span class="acronym">transfer none</span></a>]</span>
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
<div class="refsect1">
<a name="PolkitPermission.property-details"></a><h2>Property Details</h2>
<div class="refsect2">
<a name="PolkitPermission--action-id"></a><h3>The <code class="literal">"action-id"</code> property</h3>
<pre class="programlisting">  "action-id"                <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>*                : Read / Write / Construct Only</pre>
<p>
The action identifier to use for the permission.
</p>
<p>Default value: NULL</p>
</div>
<hr>
<div class="refsect2">
<a name="PolkitPermission--subject"></a><h3>The <code class="literal">"subject"</code> property</h3>
<pre class="programlisting">  "subject"                  <a class="link" href="PolkitSubject.html" title="PolkitSubject"><span class="type">PolkitSubject</span></a>*        : Read / Write / Construct Only</pre>
<p>
The <a class="link" href="PolkitSubject.html" title="PolkitSubject"><span class="type">PolkitSubject</span></a> to use for the permission. If not set during
construction, it will be set to match the current process.
</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>